﻿using Android.Content;
using MauiAndroidBluetoothTest.Services.BluetoothService;
using MauiAndroidBluetoothTest.ViewModels;

namespace MauiAndroidBluetoothTest
{
    public static class MauiProgram
    {
        public static MauiApp CreateMauiApp()
        {
            var builder = MauiApp.CreateBuilder();
            _ = builder.UseMauiApp<App>();

            _ = builder.ConfigureFonts(fonts => {
                _ = fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                _ = fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
            });

            _ = builder.Services.AddSingleton(Platform.AppContext);

            _ = builder.Services.AddSingleton<IBluetoothService, BluetoothService>();

            _ = builder.Services.AddSingleton<MainPage>();
            _ = builder.Services.AddSingleton<MainViewModel>();

            return builder.Build();
        }
    }
}